package com.franklin.validation.demo.config;

import com.franklin.validation.core.argument.resolvers.ParamCheckHandlerArgumentResolver;
import com.franklin.validation.core.webflux.filter.ArgumentFilter;
import com.franklin.validation.demo.TestFilter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.Order;
import org.springframework.web.reactive.config.EnableWebFlux;
import org.springframework.web.reactive.config.WebFluxConfigurer;
import org.springframework.web.reactive.result.method.annotation.ArgumentResolverConfigurer;
import org.springframework.web.server.WebFilter;


/**
 * Description :
 * Create By: Franklin
 * Date : 2020/6/5 15:52
 */
@Configuration
@EnableWebFlux
public class WebConfig implements WebFluxConfigurer {

    @Override
    public void configureArgumentResolvers(ArgumentResolverConfigurer configurer) {
//        configurer.addCustomResolver(new ParamCheckHandlerArgumentResolver());
    }

    @Bean
    @Order(-2)
    public WebFilter testFilter(){
        return new TestFilter();
    }

//    @Bean
//    @Order(-1)
//    public WebFilter argumentFilter(){
//        return new ArgumentFilter();
//    }

}
